/ Assembly List / LJCNetCommon / LJCReflect / SetPropertyValue

Namespace - LJCNetCommon


Parameters
propertyName - The property name.
value - The property value.

Syntax

C#
public Void SetPropertyValue(String propertyName, Object value)

Sets the property value based on value type. (E)

Example

C#
using System;
using System.Data;
using System.Data.Common;
using LJC.DataAccess;
        
// Sets the data object values from the DbColumns object.
public static void SetObjectValues(DbColumns dbColumns, object dataObject)
{
  LJCReflect reflect;

  reflect = new LJCReflect(dataObject);
  foreach (DbColumn dbColumn in dbColumns)
  {
    reflect.SetPropertyValue(dbColumn.PropertyName, dbColumn.Value);
  }
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.